<?php
/**
 * @package LaravelBoot
 *
 * @internal
 *
 * @author mawenpei
 * @date 2019/4/8 18:58
 * @version
 */
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class EverydayReport extends Model
{
    protected $table = "everyday_report";

    public $guarded = [];

    public $appends = ['app_platform_cn','app_channel_cn'];

    public function getAppPlatformCnAttribute()
    {
        $name = '';
        switch($this->attributes['app_platform']){
            case 'ios':
                $name = '苹果';
                break;
            case 'android':
                $name = '安卓';
                break;
            case 'wechart':
                $name = '微信';
                break;
            case 'all':
                $name = '全平台';
                break;
        }
        return $name;
    }

    public function getAppChannelCnAttribute()
    {
        $name = '';
        switch($this->attributes['app_channel']){
            case 'all':
                $name = '全市场';
                break;
            case 'offical':
                $name = '官方';
                break;
            case 'baidu':
                $name = '百度';
                break;
            case 'huawei':
                $name = '华为';
                break;
            case 'xiaomi':
                $name = '小米';
                break;
            case '360':
                $name = '360';
                break;
            case 'oppo':
                $name = 'OPPO';
                break;
            case 'vivo':
                $name = 'VIVO';
                break;
            case 'yingyongbao':
                $name = '应用宝';
                break;
            case 'appstore':
                $name = 'AppStore';
                break;
            case 'sanxing':
                $name = '三星';
                break;
            case 'qingming2019':
                $name = '清明';
                break;
            case 'register2019':
                $name = '推广';
                break;
            default:
                $name = '其他';
        }
        return $name;
    }
}